//分治阶乘 
#include<iostream>
using namespace std;
int fzjc(int num)
{
    if (num <= 0) return -1;
    if (num == 1)//终止条件 
        return 1;
    return fzjc(num - 1) * num;
}
int main()
{
    int num;
    cout << "请输入你要求阶乘的数:"  ;
    cin >> num;
    int result = fzjc(num);
    cout << "其阶乘为：" << result;
    return 0;
}